package top.rainf.mapper;

import org.apache.ibatis.annotations.Param;
import top.rainf.domain.vo.ChatRecord;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 星环
 * @date 2023/5/10 11:37:28
 * @description
 */
 @Mapper
public interface ChatRecordMapper {


    List<ChatRecord> selectAll();
    ChatRecord selectById(int id);

    int deleteById(int id);

    int deleteByIds(List<Integer> idList);

    int updateById(ChatRecord chatRecord);

    List<ChatRecord> selectByUserId(
            @Param("userId") int userId,
            @Param("friendId") int friendId);

    void readMsg(List<Integer> idList);

    List<ChatRecord> selectNewMsg(@Param("userId") int userId,@Param("friendId") int friendId);

    void sendMessage(@Param("userId") int userId,@Param("friendId") int friendId, @Param("msg") String msg);
}
